﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Windows.Forms;
namespace BenhVien
{
    class Connect
    {
        public SqlConnection con;
        public void connect()
        {

            con = new SqlConnection("Server=IWANTWIN-PC;user id=sa;password=123456;database=QLBenhVien");

            con = new SqlConnection("Data Source=192.168.1.200,1433;server=IWANTWIN-PC; user id=sa; password=123456; database=QLBenhVien; Connection Timeout=15");

            try
            {
                con.Open();
            }
            catch
            {
                MessageBox.Show("loi ket noi", "thu lai", MessageBoxButtons.OK);
            }
        }
        public void disconnect()
        {
           con.Close();
            con.Dispose();
            con = null;
        }
    }
}
